import React from "react";
import Layout from "@/layout";
import { RouteObject } from "../types";
import { lazyload, toPlainRoutes } from "../utils/toolkit";

const life: RouteObject[] = [
  {
    meta: {
      title: "生活",
    },
    // element: <Layout></Layout>,
    element: lazyload(React.lazy(() => import("@/layout"))),
    children: [
      {
        path: "/life/lottery",
        meta: {
          title: "搏一搏,摩托变单车",
        },
        element: lazyload(React.lazy(() => import("@/views/life/lottery"))),
      },
      {
        path: "/life/youth",
        meta: {
          title: "青春youth",
        },
        element: lazyload(React.lazy(() => import("@/views/life/youth"))),
      },
    ],
  },
];

// 去除element的引用，素路由
export const plafinFileRoutes = toPlainRoutes(life);

export default life;
